package sort;

import java.util.Random;

public class Test01 {
    public static void main(String[] args) {
        //int []arr = {5,3,1,2};
        Random r = new Random();
        int []arr = new int[100000];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt();
        }
        long start = System.currentTimeMillis();
        for(int i = 0; i < arr.length - 1; i++){
            for(int j = 0; j < arr.length - i - 1; j++){
                if(arr[j] > arr[j + 1]){
                    int temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(end-start);//14863
    }
}
